package m202406.d05;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @@author: 爱做梦的锤子
 * @date: 2024/6/5 20:29
 */
public class OD149 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String in = scanner.nextLine();
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < in.length(); i++) {
            char c = in.charAt(i);
            if (c == '-') {
                String s = ltZero(i + 1, in);
                if (!s.isEmpty()) {
                    list.add(Integer.parseInt("-" + s));
                    i = i + s.length();
                }
                continue;
            }
            if (c <= '9' && c >= '0') {
                list.add(Integer.parseInt(String.valueOf(c)));
            }
        }
        int sum = 0;
        for (Integer integer : list) {
            sum = sum + integer;
        }
        System.out.println(sum);
    }

    private static String ltZero(int index, String in) {
        for (int i = index; i < in.length(); i++) {
            char c = in.charAt(i);
            if (c > '9' || c < '0') {
                return in.substring(index, i);
            }
        }
        return in.substring(index);
    }
}
